package org.example.develop;

import java.util.Arrays;
import java.util.stream.Collectors;


/***
 * 给定一个字符串,当前字符串中使用逗号分隔成多个子串,对子串进行去重操作.
 */
public class StringUtilsUDF {

    public static String distinctString(String input) {
        if (input == null || input.isEmpty()) {
            return "";
        }
        return Arrays.stream(input.split(","))
                .distinct()
                .collect(Collectors.joining(","));
    }
}
